import random from "@/zdpui/util/random.js";

// 模拟分页获取上课记录
const mockCourseGetPage = (page = 1, size = 8) => {
    return new Promise((resolve, reject) => {
        setTimeout(() => {
            try {
                let data = []
                let offset = (page - 1) * size
                for (let i = offset; i < offset + size; i++) {
                    data.push({
                        id: i,
                        name: random.name(),
                        count: random.int(3, 20),
                        add_time: '2025-05-01 12:00:00',
                    })
                }
                resolve({
                    total: 100,
                    data,
                });
            } catch (error) {
                reject(error);
            }
        }, 1000); // 模拟 1 秒的延迟
    });
}

export default {
    mockCourseGetPage,
}